<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>navigator对象</title>
</head>
<body>
	<script type="text/javascript">
		console.log(navigator.plugins);s
		function hasPlugin(name){
			// 如果有插件 返回true 反之亦然
			name = name.toLowerCase();
			for(var i = 0; i < navigator.plugins.length; i++){
				if(navigator.plugins[i].name.toLowerCase().indexOf(name) > -1){
					// 有此插件
					return true;
				}else{
					return false;
				}
			}
		}
		alert(hasPlugin('Flash'));
		alert(hasPlugin('Chrome PDF Plugin'));

	</script>
</body>
</html>